﻿using System.Windows;
using System.Windows.Interop;
using Foundation;

namespace Poet.Helpers
{

    public static class WindowExtensions
    {
        public static void ShowAsActive(this Window window, bool active)
        {
            var hwndSource = PresentationSource.FromVisual(window) as HwndSource;
            if (hwndSource != null)
            {
                Win32Helper.SendMessage(hwndSource.Handle, 134, active ? 1 : 0, 0);
            }
        }
    }
}
